package pl.edu.agh.winmon.hibernate;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "`" + MemoryStatEntry.TABLE_NAME + "`")
public class MemoryStatEntry implements Serializable {

	@Transient
	private static final long serialVersionUID = -8269609676787119400L;

	@Transient
	public static final String TABLE_NAME = "memory_stat_entry"; //$NON-NLS-1$

	@Transient
	public static final String PROP_ID = "id"; //$NON-NLS-1$

	@Transient
	public static final String DB_ID = PROP_ID;

	@Transient
	public static final String PROP_TURN = "turn"; //$NON-NLS-1$

	@Transient
	public static final String DB_TURN = "turn_id"; //$NON-NLS-1$

	@Transient
	public static final String PROP_ACTUAL_FREE = "actualFree"; //$NON-NLS-1$

	@Transient
	public static final String DB_ACTUAL_FREE = "actual_free"; //$NON-NLS-1$

	@Transient
	public static final String PROP_ACTUAL_USED = "actualUsed"; //$NON-NLS-1$

	@Transient
	public static final String DB_ACTUAL_USED = "actual_used"; //$NON-NLS-1$

	@Transient
	public static final String PROP_FREE = "free"; //$NON-NLS-1$

	@Transient
	public static final String DB_FREE = PROP_FREE;

	@Transient
	public static final String PROP_FREE_PERCENT = "freePercent"; //$NON-NLS-1$

	@Transient
	public static final String DB_FREE_PERCENT = "free_percent"; //$NON-NLS-1$

	@Transient
	public static final String PROP_USED = "used"; //$NON-NLS-1$

	@Transient
	public static final String DB_USED = PROP_USED;

	@Transient
	public static final String PROP_USED_PERCENT = "usedPercent"; //$NON-NLS-1$

	@Transient
	public static final String DB_USED_PERCENT = "used_percent"; //$NON-NLS-1$

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = DB_ID)
	private Long id;

	@OneToOne(targetEntity = Turn.class)
	private Turn turn;

	@Column(name = DB_ACTUAL_FREE)
	private Long actualFree;

	@Column(name = DB_ACTUAL_USED)
	private Long actualUsed;

	@Column(name = DB_FREE)
	private Long free;

	@Column(name = DB_FREE_PERCENT)
	private Double freePercent;

	@Column(name = DB_USED)
	private Long used;

	@Column(name = DB_USED_PERCENT)
	private Double usedPercent;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Turn getTurn() {
		return turn;
	}

	public void setTurn(Turn turn) {
		this.turn = turn;
	}

	public Long getActualFree() {
		return actualFree;
	}

	public void setActualFree(Long actualFree) {
		this.actualFree = actualFree;
	}

	public Long getActualUsed() {
		return actualUsed;
	}

	public void setActualUsed(Long actualUsed) {
		this.actualUsed = actualUsed;
	}

	public Long getFree() {
		return free;
	}

	public void setFree(Long free) {
		this.free = free;
	}

	public Double getFreePercent() {
		return freePercent;
	}

	public void setFreePercent(Double freePercent) {
		this.freePercent = freePercent;
	}

	public Long getUsed() {
		return used;
	}

	public void setUsed(Long used) {
		this.used = used;
	}

	public Double getUsedPercent() {
		return usedPercent;
	}

	public void setUsedPercent(Double usedPercent) {
		this.usedPercent = usedPercent;
	}

}
